package com.qf.mapper;

import com.qf.pojo.Order;
import com.qf.pojo.Order1;
import org.apache.ibatis.annotations.Mapper;
import org.apache.ibatis.annotations.Select;

import java.util.List;
import java.util.Map;

@Mapper
public interface OrderMapper {
//    @Results(id = "OrderMap",value = {
//            @Result(column = "setmealId",property = "setmeals",javaType = Setmeal.class,one = @One(select = "com.qf.back.mapper.SetmealMapper.findById",fetchType = FetchType.EAGER)),
//            @Result(column = "memberId",property = "member",javaType = Member.class,one = @One(select = "com.qf.back.mapper.MemberMapper.findById",fetchType = FetchType.EAGER))
//    })
    @Select("SELECT o.id oid,m.id mid,orderDate,s.id,fileNumber,m.`name` mname,CASE m.sex WHEN '1' THEN '男' WHEN '0' THEN '女' ELSE '未知' END AS sex ,s.`name` FROM t_order o,t_member m,t_setmeal s WHERE o.`member_id`=m.`id` AND o.`setmeal_id`=s.`id`")
    List<Order> findAll();

}
